#!/usr/bin/env python
#Basic getaddrinfo() basic example

import sys, DNS

query = sys.argv[1]

DNS.DiscoverNameServers()

reqobj = DNS.Request()

answerobj = reqobj.req(name=query, qtype=DNS.Type.ANY)

if not len(answerobj.answers):
    print "Not Found"

for item in answerobj.answers:
    print "%-5s %s\n" %(item['typename'], item['data'])